﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>无标题页</title>
    <script type="text/javascript">
    function incWidth()
    {
        var width = document.getElementById("testDiv").style.width;
        var widthInteger  = parseInt(width,10);
        widthInteger = widthInteger + 50;
        document.getElementById("testDiv").style.width = widthInteger+'px';
    }
    </script>
</head>
<body>
<div id="testDiv" style="border-color:Red;border-style:dotted;border-width:1px;width:100px;">
sdsadasdadasd
</div>
<input type="button" value="长度" onclick="alert(document.getElementById('testDiv').style.width)" />
<input type="button" value="增加长度" onclick="incWidth()" />
</body>
</html>
